package com.heima.zuoye.day04.timu1;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;

public class birthday {
    public static void main(String[] args) throws ParseException {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入你的生日（格式为年月日）");
        String str = sc.next();
        SimpleDateFormat sdf = new SimpleDateFormat("y年M月dd日");
        Date date = sdf.parse(str);
        Date date1 = new Date();
        long time = date1.getTime();
        long time1 = date.getTime();
        long l = time - time1;
        int i = (int) (l / (1000 * 60 * 60 * 24));
        System.out.println("已经出生了" + i + "天");
    }
}
